Method and apparatus for identifying image type

ABSTRACT

A method is provided for identifying an image type. The method includes acquiring a histogram of a channel in a preset color space of an image to be identified, calculating a ratio between a quantity of pixels of a gray-scale value and a quantity of pixels of an adjacent gray-scale value in the channel according to the histogram, and determining a type of the image according to the ratio.

CROSS-REFERENCE TO RELATED APPLICATION

This application is based upon and claims priority to Chinese PatentApplication No. 201610097153.1, filed Feb. 22, 2016, the entire contentsof which are incorporated herein by reference.

TECHNICAL FIELD

The present disclosure generally relates to the field of communicationtechnology, and more particularly, to a method and apparatus foridentifying image type.

BACKGROUND

Images displayed on display devices may be generally divided into twotypes: synthetic images and natural images. The synthetic images areimages that are artificially synthetized by using a computer, such ascartoons, application icons, etc. And the natural images are images thatexist in the natural world and are captured by an image acquiringdevice, for example, a camera. In general, a synthetic image isartificially plotted according to characteristics of a display devicesuch that contents of the synthetic image conform to the characteristicsof the display device. For example, a beautiful image may be plottedaccording to a bit depth, a color gamut and a contrast ratio which thedisplay device is capable of presenting. A natural image generallyexhibits contents really existing in the natural world, without beingprocessed with respect to characteristics of a specific display device.Thereby, a natural image may be post-processed using a specific imageprocessing technique to make the natural image more beautiful.Post-processing of a synthetic image, however, may damage the beauty ofthe synthetic image.

Therefore, before performing a post-processing on an image, it isnecessary to identify the type of the image, such that an operation(e.g., post-processing) may be determined whether to be executed on theimage according to the identified type of the image. In this way, thebeauty of the image may be retained.

Conventionally, the type of an image may be identified by calculating anentropy of the image. If the entropy of the image is greater than apreset threshold value, the image is determined as a natural image; andif the entropy of the image is smaller than or equal to the presetthreshold value, the image is determined as a synthetic image.

SUMMARY

According to a first aspect of embodiments of the present disclosure, amethod is provided for identifying an image type. The method includesacquiring a histogram of a channel in a preset color space of an imageto be identified, calculating a ratio between a quantity of pixels of agray-scale value and a quantity of pixels of an adjacent gray-scalevalue in the channel according to the histogram, and determining a typeof the image according to the ratio.

According to a second aspect of embodiments of the present disclosure,an apparatus is provided for identifying an image type. The apparatusincludes a processor, and a memory for storing instructions executableby the processor. The processor is configured to acquire a histogram ofa channel in a preset color space of an image to be identified,calculate a ratio between a quantity of pixels of a gray-scale value anda quantity of pixels of an adjacent gray-scale value in the channelaccording to the histogram, and determine a type of the image accordingto the ratio.

According to a third aspect of the embodiments of the presentdisclosure, a non-transitory computer-readable storage medium havingstored thereon instructions is provided. The instructions, when executedby a processor in a terminal, cause the terminal to perform a method foridentifying an image type. The method includes acquiring a histogram ofa channel in a preset color space of an image to be identified,calculating a ratio between a quantity of pixels of a gray-scale valueand a quantity of pixels of an adjacent gray-scale value in the channelaccording to the histogram, and determining a type of the imageaccording to the ratio.

It is to be understood that both the foregoing general description andthe following detailed description are exemplary and explanatory onlyand are not restrictive of the invention, as claimed.

BRIEF DESCRIPTION OF THE DRAWINGS

The accompanying drawings, which are incorporated in and constitute apart of this specification, illustrate embodiments consistent with theinvention and, together with the description, serve to explain theprinciples of the invention.

FIG. 1 is a flow chart of a method for identifying an image type,according to an exemplary embodiment.

FIG. 2a is a schematic diagram of a histogram of a red channel of animage to be identified, according to an exemplary embodiment.

FIG. 2b is a schematic diagram of a histogram of a green channel of theimage to be identified, according to an exemplary embodiment.

FIG. 2c is a schematic diagram of a histogram of a blue channel of theimage to be identified, according to an exemplary embodiment.

FIG. 3a is a schematic diagram of a histogram of a red channel of animage to be identified, according to another exemplary embodiment.

FIG. 3b is a schematic diagram of a histogram of a green channel of theimage to be identified, according to another exemplary embodiment.

FIG. 3c is a schematic diagram of a histogram of a blue channel of theimage to be identified, according to another exemplary embodiment.

FIG. 4 is a flow chart of a method for identifying an image type,according to another exemplary embodiment.

FIG. 5 is a flow chart of a method for identifying an image type,according to yet another exemplary embodiment.

FIG. 6 is a block diagram of an apparatus for identifying an image type,according to an exemplary embodiment.

FIG. 7 is a block diagram of an apparatus for identifying an image type,according to another exemplary embodiment.

FIG. 8 is a block diagram of an apparatus for identifying an image type,according to yet another exemplary embodiment.

FIG. 9 is a block diagram of an apparatus for identifying an image type,according to still yet another exemplary embodiment.

FIG. 10 is a block diagram of a terminal for identifying an image type,according to an exemplary embodiment.

DETAILED DESCRIPTION

Reference will now be made in detail to exemplary embodiments, examplesof which are illustrated in the accompanying drawings. The followingdescription refers to the accompanying drawings in which the samenumbers in different drawings represent the same or similar elementsunless otherwise represented. The implementations set forth in thefollowing description of exemplary embodiments do not represent allimplementations consistent with the invention. Instead, they are merelyexemplary apparatuses and methods consistent with aspects related to theinvention as recited in the appended claims.

FIG. 1 is a flow chart of a method 100 for identifying an image type,according to an exemplary embodiment. As shown in FIG. 1, the method 100may be applied to a mobile terminal. The mobile terminal may include,but is not limited to, a mobile phone, and a tablet computer (e.g., aPAD). The method 100 may include the following steps.

In step S101, a histogram of each channel in a preset color space of animage to be identified is acquired.

In the exemplary embodiment, different types of images have differentcharacteristics in the histogram of each channel in the preset colorspace. Thereby, the type of an image may be identified by analyzingcharacteristics of the histogram of each channel.

The preset color space may be a color space including, such as ared-green-blue (RGB) color space, or a luminance (LAB) color space. Forexample, a histogram of each channel in the RGB color space of an imageto be identified may be acquired. FIGS. 2a-2c show an example of thehistograms of three channels (red, green, and blue, respectively) in theRGB color space of an image to be identified. FIGS. 3a-3c show anotherexample of the histograms of the three channels (red, green, and blue,respectively) in the RGB color space of the image to be identified. Thehorizontal axis of the histograms indicates gray-scale values of 0-255,and the vertical axis thereof indicates a quantity of pixelscorresponding to a gray-scale value.

In step S102, ratios between a quantity of pixels of a gray-scale valueand a quantity of pixels of an adjacent gray-scale value are calculatedfor each channel according to the acquired histogram.

In the exemplary embodiment, the ratios between a quantity of pixels ofa gray-scale value and a quantity of pixels of an adjacent gray-scalevalue for each channel of the image may be calculated according to theacquired histograms. For example, the ratios between a quantity ofpixels of a gray-scale value and a quantity of pixels of an adjacentgray-scale value for each of the three channels (red, green, and blue,respectively) may be calculated according to the histograms in FIGS.2a-2c , or the histograms in FIGS. 3a -3 c.

For example, for each channel, a ratio between a quantity of pixels of agray-scale value i and a quantity of pixels of a gray-scale value (i−n),and a ratio between a quantity of pixels of the gray-scale value i and aquantity of pixels of a gray-scale value (i+n) are calculated, whereinn≦i≦255−n, 1≦n≦10, and both i and n are integers. In some embodiments, nmay range from 1 to 5.

For example, the following ratios in the red channel may be calculated:a ratio between a quantity of pixels of a gray-scale value 1 and aquantity of pixels of a gray-scale value 0 and a ratio between thequantity of pixels of the gray-scale value 1 and a quantity of pixels ofa gray-scale value 2, a ratio between the quantity of pixels of thegray-scale value 2 and the quantity of pixels of the gray-scale value 1and a ratio between the quantity of pixels of the gray-scale value 2 anda quantity of pixels of a gray-scale value 3, a ratio between thequantity of pixels of the gray-scale value 3 and the quantity of pixelsof the gray-scale value 2 and a ratio between the quantity of pixels ofthe gray-scale value 3 and a quantity of pixels of a gray-scale value 4,. . . , a ratio between a quantity of pixels of a gray-scale value 254and a quantity of pixels of a gray-scale value 253 and a ratio betweenthe quantity of pixels of the gray-scale value 254 and a quantity ofpixels of a gray-scale value 255.

In the histogram of the red channel shown in FIG. 3a , for example,there are 1624 pixels of the gray-scale value 89, 1609 pixels of thegray-scale value 90, and 1554 pixels of the gray-scale value 91. Thus, aratio between the quantity of pixels of the gray-scale value 90 and thequantity of pixels of the gray-scale value 89 is 0.9907635 (i.e., 1609divided by 1624), and a ratio between the quantity of pixels of thegray-scale value 90 and the quantity of pixels of the gray-scale value91 is 1.03539253 (i.e., 1609 divided by 1554).

In step S103, if the calculated ratios satisfy a preset condition, theimage to be identified is determined as a natural image.

In the exemplary embodiment, when the preset color space is an RGB colorspace, the preset condition may be: a number of decimal places of theratio exceeds 5. If the calculated ratio satisfies a preset condition,i.e., the number of decimal places of the calculated ratio exceeds 5,then the image to be identified is a natural image. For example in FIG.3a , since the ratio between the quantity of pixels of the gray-scalevalue 90 and the quantity of pixels of the gray-scale value 89 is0.9907635, and the ratio between the quantity of pixels of thegray-scale value 90 and the quantity of pixels of the gray-scale value91 is 1.03539253, the number of decimal places of both ratios exceed 5.As such, the image corresponding to FIG. 3a may be preliminarilyidentified as a natural image. Further, If the numbers of decimal placesof ratios between pixels of adjacent gray-scale values in the histogramsshown in FIGS. 3b-3c also exceed 5, then it can be determined that theimage corresponding to FIGS. 3a-3c is a natural image.

In step S104, if the calculated ratios do not satisfy the presetcondition, the image to be identified may be determined as a syntheticimage.

In the exemplary embodiment, if the calculated ratio does not satisfythe preset condition, i.e., the calculated ratio is an integer or thenumber of decimal places of the calculated ratio does not exceed 5, thenthe image to be identified is a synthetic image.

For example, in the histogram of the red channel shown in FIG. 2a , aratio between a quantity of pixels of a gray-scale value 1 and aquantity of pixels of a gray-scale vale 0 is 0.01, and a ratio betweenthe quantity of pixel of the gray-scale value 1 and a quantity of pixelsof a gray-scale value 2 is 100. Since the calculated ratios do notsatisfy the preset condition (i.e., the number of decimal places foreach of the two ratio is less than 5), an image corresponding to FIG. 2amay be preliminarily determined to be a synthetic image. Further, if thenumber of decimal places for each of the ratios between pixels ofadjacent gray-scale values in the histograms shown in FIGS. 2b-2c doesnot satisfy the preset condition either, then the image corresponding toFIGS. 2a-2c can be determined as a synthetic image.

In some embodiments, in order to improve the accuracy of identifyingimage type, the method 100 may further include: counting the ratioswhich do not satisfy the preset condition. If the number of the ratiosexceeds a preset number, the image to be identified may be identified asa synthetic image. The preset number may be set flexibly according torequirements, for example, may be 6, 8, or the like. For example, in thehistograms of three channels shown in FIGS. 2a-2c , if the number of theratios which do not satisfy the preset condition is 508 for each of thethree channels, then it may be further determined that the imagecorresponding to FIGS. 2a-2c is a synthetic image.

In the above exemplary embodiment, a histogram for each channel in apreset color space of an image to be identified is obtained. Ratiosbetween pixels of adjacent gray-scale values in each channel arecalculated according to the acquired histograms. The type of the imageto be identified may be determined according to whether the ratiossatisfy a preset condition. No extensive computations may be neededduring the entire identifying procedure, thus the present disclosure maybe suitable for identifying an image type on a mobile terminal, such asa mobile phone.

FIG. 4 is a flow chart of a method 400 for identifying an image type,according to another exemplary embodiment. As shown in FIG. 4, inaddition to the steps shown in FIG. 1, the method 400 may furtherinclude the following step S105.

In step S105, a noise in the image to be identified is filtered out.

The noise in the image primarily refers to a rough portion in the imagegenerated when a sensor of a camera receives light rays as receivingsignals and outputs the light rays. The noise may also refer to foreignpixels that are generally generated, for example by electronicinterferences. The foreign pixels should not exist in the image.

In the exemplary embodiment, before acquiring the histogram for eachchannel in the preset color space of the image to be identified, a noisein the image may be filtered out. In this way, the acquired histogramsmay be more accurate, and the accuracy of identifying image type is thusimproved.

FIG. 5 is a flow chart of a method 500 for identifying image type,according to another exemplary embodiment. As shown in FIG. 5, themethod 500 may further include the following steps.

In step S501, characteristics information of the image to be identifiedis acquired.

In the exemplary embodiment, a characteristics library of syntheticimages may be established in advance. The characteristics libraryincludes characteristics information of the synthetic images. Thereby,by acquiring characteristics information of an image to be identified,and comparing the acquired characteristics information withcharacteristics information of the characteristics library, it mayidentify whether the image to be identified is a synthetic image.

The characteristics library may include, but is not limited to, one ormore of characteristics information of pixel numbers in three channelsin an RGB color space of synthetic images, characteristics informationof monochromic image of synthetic images, and the like.

In the exemplary embodiment, in order to compare with thecharacteristics information in the characteristics library,characteristics information of pixel numbers in three channels of an RGBcolor space of the image to be identified may be acquired, or thecharacteristics information of red image of the image to be identifiedmay be acquired.

In step S502, it is determined whether the characteristics informationof the image to be identified matches the characteristics information ina pre-established characteristics library. If they match, step S503 isperformed: otherwise, step S504 is performed.

In step S503, the image to be identified is determined as a syntheticimage.

For example, as shown in FIGS. 2a-2c , the histograms of RGB threechannels of the image to be identified are identical. As such, it can beacquired that the pixel numbers of RGB three channels of the image to beidentified are identical, i.e., characteristics information of the imagematches the characteristics information in the characteristics library.Accordingly, it may be determined that the image to be identified is asynthetic image.

In step S504, it is determined that the image to be identified is not asynthetic image.

In the exemplary embodiment, if the characteristics information of theimage to be identified does not match the characteristics information inthe pre-established characteristics library, it may be determined thatthe image to be identified is not a synthetic image.

In some embodiments, in addition to using this manner to identify animage type, it may also use this manner to correct an image type thathas already been identified. For example, given that an image has beenidentified as a synthetic image, it may further determine whether theimage is a synthetic image by acquiring characteristics information ofthe image and comparing the acquired characteristics information withcharacteristics information in a characteristics library. As such, theaccurate rate of identification may be significantly improved.

In the above exemplary embodiment, whether an image to be identified isa synthetic image is determined by determining whether the acquiredcharacteristics information of the image to be identified matchescharacteristics information in a pre-established characteristicslibrary, providing an additional means for identifying a syntheticimage. As such, the manners for identifying image type are diversified.In addition, such means may also be employed to correct an alreadyidentified image type, thereby greatly improving the accuracy rate ofidentification.

Corresponding to the above methods for identifying an image type, thepresent disclosure also provides apparatus embodiments for identifyingan image type.

FIG. 6 is a block diagram of an apparatus 600 for identifying an imagetype, according to an exemplary embodiment. As shown in FIG. 6, theapparatus 600 may include an acquiring module 61, a calculating module62, a first determining module 63, and a second determining module 64.

The acquiring module 61 is configured to acquire a histogram of eachchannel in a preset color space of an image to be identified.

In the exemplary embodiment, different types of images have differentcharacteristics in the histograms of respective channels in the presetcolor space. Thereby, the type of an image may be identified byanalyzing the characteristics of the histograms.

The preset color space may be a color space including, such as ared-green-blue (RGB) color space, or a luminance (LAB) color space.

For example, histograms of respective channels in the RGB color space ofan image to be identified may be acquired. FIGS. 2a-2c show an exampleof histograms of RGB three channels (red, green, and blue, respectively)of an image to be identified, FIGS. 3a-3c show another example ofhistograms of RGB three channels (red, green, and blue, respectively) ofan image to be identified.

The horizontal axis of the histograms indicates gray-scale values 0-225,and the vertical axis thereof indicates a quantity of pixelscorresponding to a gray-scale value.

The calculating module 62 is configured to calculate ratios betweenpixels of adjacent gray-scale values in each channel according to thehistograms acquired by the acquiring module 61.

In the exemplary embodiment, the ratios between pixel quantities ofadjacent gray-scale values in each channel of the image may becalculated according to the acquired histograms.

For example, ratios between pixel quantities of adjacent gray-scalevalues in RGB three channels may be calculated according to thehistograms shown in FIGS. 2a-2c , or the histograms shown in FIGS. 3a -3c.

In the exemplary embodiment, the manner for calculating the ratiosbetween pixel quantities of adjacent gray-scale values in each channelmay be as follows.

For example, for each channel, a ratio between a quantity of pixels of agray-scale value i and a quantity of pixels of a gray-scale value (i−n)and a ratio between the quantity of pixels of the gray-scale value i anda quantity of pixels of a gray-scale value (i+n) may be calculated,wherein n≦i≦255−n, 1≦n≦10, and both i and n are integers. In someembodiments, n may range from 1 to 5.

For example, the following ratios in the red channel may be calculated:a ratio between a quantity of pixels of a gray-scale value 1 and aquantity of pixels of a gray-scale value 0 and a ratio between thequantity of pixels of the gray-scale value 1 and a quantity of pixels ofa gray-scale value 2, a ratio between the quantity of pixels of thegray-scale value 2 and the quantity of pixels of the gray-scale value 1and a ratio between the quantity of pixels of the gray-scale value 2 anda quantity of pixels of a gray-scale value 3, a ratio between thequantity of pixels of the gray-scale value 3 and the quantity of pixelsof the gray-scale value 2 and a ratio between the quantity of pixels ofthe gray-scale value 3 and a quantity of pixels of a gray-scale value 4,. . . , a ratio between a quantity of pixels of a gray-scale value 254and a quantity of pixels of a gray-scale value 253 and a ratio betweenthe quantity of pixels of the gray-scale value 254 and a quantity ofpixels of a gray-scale value 255.

For example, in the histogram of the red channel shown in FIG. 3a ,there are 1624 pixels of the gray-scale value 89, 1609 pixels of thegray-scale value 90, and 1554 pixels of the gray-scale value 91. A ratiobetween the quantity of pixels of the gray-scale value 90 and thequantity of pixels of the gray-scale value 89 is 0.9907635 (i.e., 1609divided by 1624), and a ratio between the quantity of pixels of thegray-scale value 90 and the quantity of pixels of the gray-scale value91 is 1.03539253 (i.e., 1609 divided by 1554).

The first determining module 63 is configured to, if the ratiocalculated by the calculating module 62 satisfies a preset condition,determine the image as a natural image.

In the exemplary embodiment, when the preset color space is RGB, thepreset condition may be: a number of decimal places of the ratio exceeds5. If the calculated ratio satisfies a preset condition, i.e., thenumber of decimal places of the calculated ratio exceeds 5, then theimage to be identified is a natural image.

In the above example, since the ratio between the quantity of pixels ofthe gray-scale value 90 and the quantity of pixels of the gray-scalevalue 89 is 0.9907635, and the ratio between quantity of pixels of thegray-scale value 90 and the quantity of pixels of the gray-scale value91 is 1.03539253, the numbers of decimal places of both ratios exceed 5.As such, it may be determined preliminarily that the image correspondingto FIG. 3a is a natural image. Further, if the numbers of decimal placesof the ratios between pixel quantities of adjacent gray-scale values inthe histograms shown in FIGS. 3b-3c also exceed 5, then it can bedetermined that the image corresponding to FIGS. 3a-3c is a naturalimage.

The second determining module 64 is configured to, if the ratiocalculated by the calculating module 62 does not satisfy the presetcondition, determine the image to be identified as a synthetic image.

In the exemplary embodiment, if the calculated ratio does not satisfythe preset condition, i.e., the calculated ratio is an integer or thenumber of decimal places of the calculated ratio does not exceed 5, thenthe image to be identified is a synthetic image.

For example, in the histogram of the red channel shown in FIG. 2a , aratio between the quantity of pixels of the gray-scale value 1 and thequantity of pixels of the gray-scale value 0 is 0.01, and a ratiobetween the quantity of pixels of the gray-scale value 1 and thequantity of pixels of the gray-scale value 2 is 100. Since thecalculated ratios do not satisfy the preset condition, it may bedetermined preliminarily that the image corresponding to FIG. 2a is asynthetic image. Further, if the numbers of decimal places of the ratiosbetween the quantities of pixels of adjacent gray-scale values in thehistograms shown in FIGS. 2b-2c do not satisfy the preset conditioneither, then it can be determined that the image corresponding to FIGS.2a-2c is a synthetic image.

The apparatus 600 shown in FIG. 6 may be applied for implementing themethod 100 shown in FIG. 1, and the involved relevant contents aresimilar, which are not repeated herein.

In the above exemplary embodiments of the apparatus 600 for identifyingan image type, histograms of respective channels in a preset color spaceof an image to be identified are acquired. Ratios between quantities ofpixels of adjacent gray-scale values in respective channels according tothe acquired histograms are calculated. And then the type of the imageto be identified is determined according to whether the ratios satisfy apreset condition. No extensive computations may be needed during theentire identifying procedure, thus the present disclosure may besuitable for identifying image type in a mobile terminal, such as themobile phone.

FIG. 7 is a block diagram of an apparatus 700 for identifying an imagetype, according to another exemplary embodiment. As shown in FIG. 7, inaddition to the modules shown in FIG. 6, the apparatus 700) may furtherinclude a statistical module 65 and a third determining module 66.

The statistical module 65 is configured to count the ratios which do notsatisfy the preset condition.

The third determining module 66 is configured to, if the number of theratios obtained by the statistical module 65 exceeds a preset number,determine the image to be identified as a synthetic image.

In the exemplary embodiment, in order to improve accuracy rate ofidentifying image type, the apparatus 700 further counts the ratioswhich do not satisfy the preset condition. If the number of the ratiosexceeds a preset number, the image to be identified may be determined asa synthetic image. The preset number may be set flexibly according torequirements, for example, may be 6, or 8, or the like.

For example, in the histograms of three channels shown in FIGS. 2a-2c ,the number of the ratios which do not satisfy the preset condition is508 for each channel, then it may be further determined that the imagecorresponding to FIGS. 2a-2c is a synthetic image.

The apparatus 700 shown in FIG. 7 may be applied for implementing themethod 100 procedure shown in FIG. 1, and the involved relevant contentsare similar, which are not repeated herein.

In the above exemplary embodiments of apparatus 700 for identifyingimage type, when the statistical number of the ratios exceeds the presetnumber, it is determined that the image to be identified is a syntheticimage. As such, the accuracy rate of identifying image type may beimproved.

FIG. 8 is a block diagram of an apparatus 800 for identifying an imagetype, according to another exemplary embodiment. As shown in FIG. 8, inaddition to the modules shown in FIG. 6, the apparatus 800 may furtherinclude a filtering module 60.

The filtering module 60 is configured to, before acquiring thehistograms of respective channels in the preset color space of the imageto be identified by the acquiring module 61, filter out a noise in theimage to be identified.

The noise in the image mainly refers to a rough portion in the imagegenerated when a sensor of a camera receives light rays as receivingsignals and outputs the light rays. The noise may also refer to foreignpixels, which is generally generated by electronic interferences. Andthe foreign pixels should not exist in the image.

In the exemplary embodiment, before acquiring the histograms ofrespective channels in the preset color space of the image to beidentified, the noise in the image to be identified may be filtered out.In this way, the acquired histograms may be more accurate, and theaccuracy rate of identifying image type is thus improved.

The apparatus 800 shown in FIG. 8 may be applied for implementing themethod 400 shown in FIG. 4, and the involved relevant contents aresimilar, which are not repeated herein.

In the above exemplary embodiment of the apparatus 800 for identifyingan image type, the noise in the image to be identified is filtered out.The acquired histograms are more accurate, and the accuracy rate ofidentifying an image type is thus improved.

FIG. 9 is a block diagram of an apparatus 900 for identifying an imagetype, according to yet another exemplary embodiment. As shown in FIG. 9,the apparatus 900 may include a characteristics information acquiringmodule 91, a determining module 92, and a fourth determining module 93.

The characteristics information acquiring module 91 is configured toacquire characteristics information of the image to be identified.

In the exemplary embodiment, a characteristics library of syntheticimages may be established in advance. The characteristics libraryincludes characteristics information belonging to the synthetic images.Thereby, by acquiring characteristics information of the image to beidentified, and comparing the acquired characteristics information withcharacteristics information of the characteristics library, it ispossible to identify whether the image to be identified is a syntheticimage.

The characteristics library may include, but is not limited to one ormore of characteristics information of pixel numbers in three channelsof RGB of synthetic images, characteristics information of monochromeimages of synthetic images, and the like.

In the exemplary embodiment, in order to compare with characteristicsinformation in the characteristics library, the characteristicsinformation of pixel numbers in three channels of RGB of the image to beidentified may be acquired, or the characteristics information of redimage of the image to be identified may be acquired.

The determining module 92 is configured to determine whether thecharacteristics information of the image to be identified acquired bythe characteristics information acquiring module 91 matchescharacteristics information in a pre-established characteristicslibrary. The characteristics library includes characteristicsinformation belonging to synthetic images.

The fourth determining module 93 is configured to, if the determiningmodule 92 determines that they match, determine the image to beidentified as a synthetic image.

For example, in FIGS. 2a-2c , the histograms of RGB three channels ofthe image to be identified are identical, thereby it can be determinedthat the pixel numbers for each of RGB three channels of the image to beidentified are identical, i.e., characteristics information of the imagematches the characteristics information in the characteristics library.Thus it may be determined that the image to be identified is a syntheticimage.

In the exemplary embodiment, if the characteristics information of theimage to be identified does not match the characteristics information inthe pre-established characteristics library, it may be determined thatthe image to be identified is not a synthetic image.

In some embodiments, in addition to using this manner to identify theimage type, it may use this manner to correct an already identifiedimage type. For example, given that an image has been identified as asynthetic image, it may further determine whether the image is asynthetic image by acquiring the characteristics information of theimage and comparing the characteristics information with thecharacteristics information in the characteristics library. Accordingly,the accurate rate of identification is significantly improved.

The apparatus 900 shown in FIG. 9 may be used for implementing themethod 500 shown in FIG. 5, and the involved relevant contents aresimilar, which are not repeated herein.

In the above exemplary embodiment of apparatus 900 for identifying imagetype, whether an image to be identified is a synthetic image isdetermined by determining whether the acquired characteristicsinformation in the image to be identified matches characteristicsinformation in the pre-established characteristics library, providing anadditional means for identifying a synthetic image. As such, the mannersfor identifying image type are diversified. In addition, it may correctan already identified image type, thereby greatly improving the accuracyrate of identification.

With respect to the apparatuses in the above exemplary embodiments, thespecific manners for performing operations for individual modules andsubmodules therein have been described in detail in the embodimentsregarding the methods, which will not be repeated herein.

FIG. 10 is a block diagram of a terminal 1000 for identifying an imagetype, according to an exemplary embodiment. For example, the terminal1000 may be a mobile phone, a computer, a digital broadcast terminal, amessaging device, a gaming console, a tablet, a medical device, exerciseequipment, a personal digital assistant, an aircraft and the like.

Referring to FIG. 10, the terminal 1000 may include one or more of thefollowing components: a processing component 1002, a storage component1004, a power component 1006, a multimedia component 1008, an audiocomponent 1010, an input/output (I/O) interface 1012, a sensor component1014, and a communication component 1016.

The processing component 1002 typically controls overall operations ofthe terminal 1000, such as the operations associated with display,telephone calls, data communications, camera operations, and recordingoperations. The processing component 1002 may include one or moreprocessors 1020 to execute instructions to perform all or part of thesteps in the above described methods. Moreover, the processing component1002 may include one or more modules which facilitate interactionsbetween the processing component 1002 and other components. Forinstance, the processing component 1002 may include a multimedia moduleto facilitate interactions between the multimedia component 1008 and theprocessing component 1002.

The storage component 1004 is configured to store various types of datato support the operation of the terminal 1000. Examples of such datainclude instructions for any applications or methods operated on theterminal 1000, contact data, phonebook data, messages, images, video,etc. The storage component 1004 may be implemented using any type ofvolatile or non-volatile memory devices, or a combination thereof, suchas a static random access memory (SRAM), an electrically erasableprogrammable read-only memory (EEPROM), an erasable programmableread-only memory (EPROM), a programmable read-only memory (PROM), aread-only memory (ROM), a magnetic memory, a flash memory, a magnetic oroptical disk.

The power component 1006 provides power to various components of thedevice 1000. The power component 1006 may include a power managementsystem, one or more power sources, and any other components associatedwith the generation, management, and distribution of power in theterminal 1000.

The multimedia component 1008 includes a screen providing an outputinterface between the terminal 1000 and a user. In some embodiments, thescreen may include a liquid crystal display (LCD) and a touch panel(TP). If the screen includes the touch panel, the screen may beimplemented as a touch screen to receive input signals from the user.The touch panel includes one or more touch sensors to sense touches,swipes, and gestures on the touch panel. The touch sensors may not onlysense a boundary of a touch or swipe action, but also sense a period oftime and a pressure associated with the touch or swipe action. In someembodiments, the multimedia component 1008 may include a front cameraand/or a rear camera. The front camera and/or the rear camera mayreceive an external multimedia datum while the terminal 1000 is in anoperation mode, such as a photographing mode or a video mode. Each ofthe front camera and the rear camera may be a fixed optical lens systemor have focus and optical zoom capability.

The audio component 1010 is configured to output and/or input audiosignals. For example, the audio component 1010 may include a microphone(“MIC”) configured to receive an external audio signal when the terminal1000 is in an operation mode, such as a call mode, a recording mode, anda voice identification mode. The received audio signal may be furtherstored in the storage component 1004 or transmitted via thecommunication component 1016. In some embodiments, the audio component1010 further includes a speaker to output audio signals.

The I/O interface 1012 provides an interface between the processingcomponent 1002 and peripheral interface modules, such as a keyboard, aclick wheel, buttons, and the like. The buttons may include, but are notlimited to, a home button, a volume button, a starting button, and alocking button.

The sensor component 1014 may include one or more sensors to providestatus assessments of various aspects of the terminal 1000. Forinstance, the sensor component 1014 may detect an open/closed status ofthe device 1000, relative positioning of components, e.g., the displayand the keypad, of the device 1000, a change in position of the terminal1000 or a component of the terminal 1000, a presence or absence of usercontact with the terminal 1000, an orientation or anacceleration/deceleration of the terminal 1000, and a change intemperature of the terminal 1000. The sensor component 1014 may includea proximity sensor configured to detect the presence of nearby objectswithout any physical contact. The sensor component 1014 may also includea light sensor, such as a CMOS or CCD image sensor, for use in imagingapplications. In some embodiments, the sensor component 1014 may alsoinclude an accelerometer sensor, a gyroscope sensor, a magnetic sensor,a pressure sensor, or a temperature sensor.

The communication component 1016 is configured to facilitate wired orwireless communications between the terminal 1000 and other devices. Theterminal 1000 can access a wireless network based on a communicationstandard, such as WiFi, 2G, or 3G, or a combination thereof. In oneexemplary embodiment, the communication component 1016 receives abroadcast signal from an external broadcast management system via abroadcast channel or broadcast associated information. In one exemplaryembodiment, the communication component 1016 may further include a nearfield communication (NFC) module to facilitate short-rangecommunications. For example, the NFC module may be implemented based ona radio frequency identification (RFID) technology, an infrared dataassociation (IrDA) technology, an ultra-wideband (UWB) technology, aBluetooth (BT) technology, and other technologies.

In exemplary embodiments, the terminal 1000 may be implemented with oneor more application specific integrated circuits (ASICs), digital signalprocessors (DSPs), digital signal processing devices (DSPDs),programmable logic devices (PLDs), field programmable gate arrays(FPGAs), controllers, micro-controllers, microprocessors, or otherelectronic components, for performing the above described methods.

In some embodiments, a non-transitory computer-readable storage mediumhaving instructions stored thereon is provided, such as the storagecomponent 1004 having instructions stored thereon. The instructions areexecutable by the processor 1020 in the terminal 1000, for performingthe above-described methods. For example, the non-transitorycomputer-readable storage medium may be a ROM, a RAM, a CD-ROM, amagnetic tape, a floppy disc, an optical data storage device, and thelike.

Other embodiments of the invention will be apparent to those skilled inthe art from consideration of the specification and practice of theinvention disclosed here. This application is intended to cover anyvariations, uses, or adaptations of the invention following the generalprinciples thereof and including such departures from the presentdisclosure as come within known or customary practice in the art. It isintended that the specification and examples be considered as exemplaryonly, with a true scope and spirit of the invention being indicated bythe following claims.

It will be appreciated that the present invention is not limited to theexact construction that has been described above and illustrated in theaccompanying drawings, and that various modifications and changes can bemade without departing from the scope thereof. It is intended that thescope of the invention only be limited by the appended claims.

What is claimed is:
 1. A method for identifying an image type,comprising: acquiring a histogram of a channel in a preset color spaceof an image to be identified; calculating a ratio between a quantity ofpixels of a gray-scale value and a quantity of pixels of an adjacentgray-scale value in the channel according to the histogram; anddetermining a type of the image according to the ratio.
 2. The method ofclaim 1, wherein the determining the type of the image comprises: whenthe ratio satisfies a preset condition, determining the image as anatural image; and when the ratio does not satisfy the preset condition,determining the image as a synthetic image.
 3. The method of claim 2,wherein: the preset color space includes a red-green-blue (RGB) colorspace; and the preset condition includes a number of decimal places ofthe ratio exceeding
 5. 4. The method of claim 1, wherein the calculatingthe ratio between the quantity of pixels of the gray-scale value and thequantity of pixels of the adjacent gray-scale value comprises:calculating a ratio between a quantity of pixels of a gray-scale value iand a quantity of pixels of a gray-scale value (i−n) in the channel, andcalculating a ratio between the quantity of pixels of the gray-scalevalue i and a quantity of pixels of a gray-scale value (i+n) in thechannel, wherein n≦i≦255−n, 1≦n≦10, and both i and n are integers. 5.The method of claim 2, wherein when more than one ratio are calculatedfor the channel, the method further comprises: counting ratios which donot satisfy the preset condition; and when a number of the countedratios exceeds a preset number, determining the image as the syntheticimage.
 6. The method of claim 1, further comprising: prior to acquiringthe histogram of the channel in the preset color space of the image,filtering out a noise in the image.
 7. The method of claim 1, furthercomprising: acquiring characteristics information of the image:determining whether the characteristics information of the image matchescharacteristics information in a pre-established characteristicslibrary, the characteristics library including characteristicsinformation of synthetic images; and when the characteristicsinformation of the image matches the characteristics information in thepre-established characteristics library, determining the image as asynthetic image.
 8. An apparatus for identifying an image type,comprising: a processor; and a memory for storing instructionsexecutable by the processor; wherein the processor is configured to:acquire a histogram of a channel in a preset color space of an image tobe identified; calculate a ratio between a quantity of pixels of agray-scale value and a quantity of pixels of an adjacent gray-scalevalue in the channel according to the histogram; and determine a type ofthe image according to the ratio.
 9. The apparatus of claim 8, whereinthe processor is further configured to: when the ratio satisfies apreset condition, determine the image as a natural image; and when theratio does not satisfy the preset condition, determine the image as asynthetic image.
 10. The apparatus of claim 9, wherein: the preset colorspace includes a red-green-blue (RGB) color space; and the presetcondition includes a number of decimal places of the ratio exceeding 5.11. The apparatus of claim 8, wherein the processor is furtherconfigured to: calculate a ratio between a quantity of pixels of agray-scale value i and a quantity of pixels of a gray-scale value (i−n)in the channel; and calculate a ratio between a quantity of pixels ofthe gray-scale value i and a quantity of pixels of a gray-scale value(i+n) in the channel, wherein n≦i≦255−n, 1≦n≦10, and both i and n areintegers.
 12. The apparatus of claim 9, wherein when more than one ratioare calculated, the processor is further configured to: count ratioswhich do not satisfy the preset condition; and when a number of thecounted ratios exceeds a preset number, determine the image as thesynthetic image.
 13. The apparatus of claim 8, wherein the processor isfurther configured to: prior to acquiring the histogram of the channelin the preset color space of the image, filter out a noise in the image.14. The apparatus of claim 8, wherein the processor is furtherconfigured to: acquire characteristics information of the image;determine whether the acquired characteristics information of the imagematches characteristics information in a pre-established characteristicslibrary, the characteristics library including characteristicsinformation of synthetic images; and when it is determined the acquiredcharacteristics information of the image matches the characteristicsinformation in the pre-established characteristics library, determinethe image as a synthetic image.
 15. A non-transitory computer-readablestorage medium having stored thereon instructions that, when executed bya processor in a terminal, cause the terminal to perform a method foridentifying an image type, the method comprising: acquiring a histogramof a channel in a preset color space of an image to be identified;calculating a ratio between a quantity of pixels of a gray-scale valueand a quantity of pixels of an adjacent gray-scale value in the channelaccording to the histogram; and determining a type of the imageaccording to the ratio.
 16. The non-transitory computer-readable storagemedium of claim 15, wherein the determining the type of the imagecomprises: when the ratio satisfies a preset condition, determining theimage as a natural image; and when the ratio does not satisfy the presetcondition, determining the image as a synthetic image.
 17. Thenon-transitory computer-readable storage medium of claim 16, wherein:the preset color space includes a red-green-blue (RGB) color space; andthe preset condition includes a number of decimal places of the ratioexceeding
 5. 18. The non-transitory computer-readable storage medium ofclaim 16, wherein when more than one ratio are calculated for thechannel, the method further comprises: counting ratios which do notsatisfy the preset condition; and when a number of the counted ratiosexceeds a preset number, determining the image as the synthetic image.19. The non-transitory computer-readable storage medium of claim 15,further comprising: prior to acquiring the histogram of the channel inthe preset color space of the image, filtering out a noise in the image.20. The non-transitory computer-readable storage medium of claim 15,further comprising: acquiring characteristics information of the image;determining whether the characteristics information of the image matchescharacteristics information in a pre-established characteristicslibrary, the characteristics library including characteristicsinformation belonging to synthetic images; and when the characteristicsinformation of the image matches the characteristics information in thepre-established characteristics library, determining the image as asynthetic image.